package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

@Controller
public class HelloAnnotationController {

    @RequestMapping("/sayHello")
    public ModelAndView sayHello(HttpServletRequest request){
        System.out.println("HelloAnnotationController.sayHello");

        String name=request.getParameter("name");

        return new ModelAndView("hello","message","Hello "+name+"!");

    }

}
